// 自定义hooks
import { onMounted, ref } from "vue";
import { getBuildingAllApi } from "../api/floor.js";




// 获取所有楼栋分类
export const useBuildAllList = () => {
    // 获取楼栋的分类
    const buildList = ref([])
    // 定义方法
    const getAllBuildList = async () => {
        let res = await getBuildingAllApi()
        buildList.value = res.data
    }
    onMounted(() => {
        getAllBuildList()
    })
    return buildList
}


// 获取活动状态
export const useActivityStatus = () => {
    let statusList = [
        { label: '有效', value: 1 },
        { label: '无效', value: 2 }
    ]

    return statusList
}

// export const useActivityStatus = (needAll = false) => {
//     let statusList = [
//         { label: '有效', value: 1 },
//         { label: '无效', value: 0 }
//     ]
//     if (needAll) statusList.unshift({ label: '全部', value: '' })
//     return statusList
// }